package mapData;
import java.awt.Color;


public class UnitRow
{
    private int unitID; //0 = footman;  1 = archer
    private Coord leftMostCoord;
    private int rowSize;
    private int spacing;
    private Color unitColor; 
    private int cntr = 0;
    private boolean finished = false;
    
    public UnitRow(int ID, Coord lm, int size, int spcng, Color col)
    {
        unitID = ID;
        leftMostCoord = lm;
        rowSize = size;
        spacing = spcng;
        unitColor = col;
    }
    
    public int getID()
    {
        return unitID;
    }
    
    public Coord getNextUnitPos()
    {
        Coord pos = new Coord(leftMostCoord.getX()+(spacing+1)*cntr, leftMostCoord.getY());
        
        cntr ++;
        if(cntr<rowSize)
            finished = false;
        else
            finished = true;
        return pos;
    }
    
    public boolean isFinished()
        //determines whether iteration is done
    {
        return finished;
    }
    
    public Color getRowColor()
    {
        return unitColor;
    }
    
    public void resetCntr()
    {
        cntr = 0;
    }
    
}  